// LangUtils.h

#ifndef __LANGUTILS_H
#define __LANGUTILS_H

#include "Lang.h"
#include "Common/String/ResourceString.h"

#include <vector>

extern CString g_LangID;

namespace Common
{
namespace Lang
{

struct CIDLangPair
{
  int ControlID;
  UINT32 LangID;
};

void ReloadLang();
void LoadLangOneTime();
void ReloadLangSmart();

struct CLangEx
{
  CLang Lang;
  CString ShortName;
  CLangEx() {}
  CLangEx(const CLangEx &obj):
	  Lang(obj.Lang), ShortName(obj.ShortName)
  {
  }
  CLangEx & operator=(const CLangEx & obj)
  {
	  Lang = obj.Lang;
	  ShortName = obj.ShortName;
	  return *this;
  }
};

void LoadLangs(std::vector<CLangEx> &langs);

void LangSetDlgItemsText(HWND dialogWindow, CIDLangPair *idLangPairs, int numItems);
void LangSetWindowText(HWND window, UINT32 langID);

CString LangString(UINT32 langID);
CString LangString(UINT resourceID, UINT32 langID);

#ifdef LANG
#define LangStringSpec(resourceID, langID) LangString(resourceID, langID)
#else
#define LangStringSpec(resourceID, langID) NWindows::MyLoadString(resourceID)
#endif


}
}

#endif
